According to U.S. Pat. No. 4,571,678, a register allocation method has been proposed in which inter-variable allocation sequences are generated to allocate each of a plurality of variables to a register different from registers to which some other of the variables simultaneously used are allocated. The variables are successively allocated to the registers in accordance with the allocation sequences. This method minimizes the number of times the value of each variable is saved to a memory, or retrieved from a memory, to limit the amount of access to the memory.
The above-described method, however, does not prevent a reduction in the speed of execution of generated instructions in a computer having a plurality of registers differing in characteristics from each other, because a mismatch may occur between the way of using a variable and the register allocated for the variable.